package grape.composite.rest.activity.mvc;

import grape.common.rest.advice.DisableGRB;
import grape.common.rest.advice.DisableGRM;
import grape.common.rest.mvc.SuperController;
import grape.composite.service.activity.api.IActivityService;
import grape.composite.service.activity.po.Activity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * <p>
 * 活动内部调用接口
 * </p>
 *
 * @author yangwei
 * @since 2019-5-8
 */
@RestController
@RequestMapping("/composite/activity")
@ApiIgnore
public class ActivityInnerController extends SuperController {
    @Autowired
    private IActivityService iActivityService;

    @DisableGRM
    @DisableGRB
    @GetMapping("/inner/getActivityById")
    public Activity getActivityById(String id){
        return iActivityService.getById(id);
    }

    @DisableGRM
    @DisableGRB
    @GetMapping("/inner/getActivityByCode")
    public Activity getActivityByCode(String code){
        return iActivityService.getByCode(code);
    }

}
